﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

using Microsoft.Xna.Framework.Media;

namespace Objects
{
    public class EnvironmentObject : BaseObject
    {
        public EnvironmentObject()
        {
            ObjectType = Types.EnvironmentObject;
            Position = new Vector2(400, 400);
            Image = States.GameplayState.theTextureManager.GetTexture("BOX");
            CollisionRect = new Rectangle((int)Position.X, (int)Position.Y, Image.Width, Image.Height);

            IsActive = true;
        }
        public override void Update(float ElapsedTime)
        {
        }
        public override void Render(float ElapsedTime, SpriteBatch theSpriteBatch)
        {
            RoyalRumble.MainGame.spriteBatch.Draw(Image, Position, Color.White);
        }
        public override void CheckCollision(BaseObject theObject)
        {
            if (theObject.ObjectType == Types.Bullet && CollisionRect.Intersects(theObject.CollisionRect))
            {   
                theObject.IsActive = false;
            }
        }
    }
}